<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/WEB-INF/view/include/inc.jsp"%>
<!DOCTYPE html >
<html>
<head>
    <%@ include file="../../jQgrid.jsp"%>
    
</head>
<body style="background-color: white;" class="gray-bg">
<div class="wrapper wrapper-content animated">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form  class="form-horizontal m-t" id="signupForm">
                        <input id="id" name="id" value="${android.id }" class="form-control" type="hidden">
                        <input id="name" name="name" class="form-control" type="hidden" value="${android.name }" aria-required="true">
                        <input id="path" name="path" class="form-control" type="hidden" value="${android.path }" aria-required="true">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">版本：</label>
                            <div class="col-sm-8">
                                <input id="versionCode" name="versionCode" class="form-control" type="text"
                                       value="${android.versionCode }" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">版本号：</label>
                            <div class="col-sm-8">
                                <input id="versionName" name="versionName" class="form-control" type="text"
                                       value="${android.versionName }" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">版本描述：</label>
                            <div class="col-sm-8">
                                <input id="description" name="description" class="form-control" type="text"
                                       value="${android.description }" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">apk文件：</label>
                            <div class="col-sm-8">
                                <input id="file" name="file" class="form-control" type="file" aria-required="true">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">备注说明：</label>
                            <div class="col-sm-8">
                                <textarea id="remarks" name="remarks" rows="8" cols="65" class="form-control" type="text"><c:out value="${android.remarks }"/></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button class="btn btn-primary" type="button"  id="submit">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<script>
    $(function(){
        $("#submit").click(function(){
            $("#signupForm").ajaxSubmit({
                url:'<%=contextPath %>/app/update',
                dataType:"json",
                type:"post",
                success:function(data){
                    if(data.code==200){
                        swal({
                            title: data.message,
                            type: "success",
                            showCancelButton: false,
                            confirmButtonText: "确定",
                            animation:"slide-from-bottom",
                            closeOnConfirm: true
                        },function(){
                            top.Dialog.close();
                        });
                    }else{
                        swal("错误", data.message, "error");
                    }
                }
            });
        });
    });
</script>
</body>
</html>